<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('系统 - 任务指派列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                    </div>
                </form>
            </div>

            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:taskdo:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:taskdo:remove')}]];
        var prefix = ctx + "system/taskdo";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "系统 - 任务指派",
                columns: [{
                    checkbox: true
                },
                {
                    field : 'id', 
                    title : 'null',
                    visible: false
                },
               /* {
                    field : 'pid', 
                    title : '父ID'
                },*/
                {
                    field : 'tName',
                    title : '任务名称'
                },
               /* {
                    field : 'level', 
                    title : '层级，1所，2站。'
                },

                {
                    field : 'finishNum', 
                    title : '完成数量,只有level为1时有效'
                },
                {
                    field : 'num', 
                    title : '发布数量'
                },*/
                {
                    field : 'deptName',
                    title : '地区名称'
                },
                {
                    field : 'finishTime', 
                    title : '完成时间'
                },
                    {
                        field : 'status',
                        title : '是否完成',
                        formatter: function(value, row, index) {
                            if (row.status == 0) {
                                return row.status = "未完成";
                            }else if (row.status == 1) {
                                return  row.status ="已反馈";
                            }else if (row.status == 2) {
                                return  row.status ="已完成";
                            }
                        }
                    },
              /*  {
                    field : 'doId', 
                    title : '完成者ID'
                },
                {
                    field : 'doName', 
                    title : '完成者'
                },*/
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>